﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Edit.aspx.cs" Inherits="H2.NET.Web.Management.Config.Edit" %>

<div class="pageContent">
    <form method="post" action="<%=H2.NET.Common.AksRequest.GetVirtualUrl()%>?action=save" class="pageForm required-validate" onsubmit="return validateCallback(this, initMenu);">
    
    <input type="hidden" runat="server" id="hd_parentId" name="hd_parentId"/>
    <input type="hidden" runat="server" id="rel" name="rel"/>
    
    <div class="pageFormContent" layouth="50">
        <input type="hidden" name="id" value="<%= config.ConfigID %>" />
        <table class="formTable">
            <tr>
                <th width="30%">名称： </th>
                <td width="70%">
                    <input name="name"  class="required"  type="text"   value="<%= config.Name %>" style="width:80%"/>
                </td>
            </tr>
            <tr>
                <th>内容： </th>
                <td>
                    <input name="value" class="required"  type="text"  value="<%= config.Value%>" style="width:80%"/>
                </td>
            </tr>
            <tr>
                <th>序号： </th>
                <td>
                    <input name="Order_xh" class="required"  type="text" value="<%= config.Seq%>" />
                </td>
            </tr>
            <tr>
                <th>Code：</th>
                <td width="80%">
                    <input name="Code" readonly type="text" value="<%= config.Code%>" />
                </td>
            </tr>
        </table>
    </div>
    <div class="formBar">
        <ul>
            <li>
                <div class="buttonActive">
                    <div class="buttonContent">
                        <button type="submit">保存数据</button></div>
                </div>
            </li>
            <li>
                <div class="button">
                    <div class="buttonContent">
                        <button type="button" class="close">关闭窗口</button></div>
                </div>
            </li>
        </ul>
    </div>
    </form>
</div>

<script type="text/javascript">
    function initMenu(json) {

        var pId = $("#hd_parentId").val();
        if (pId == "") {
            $.ajax({
                type: 'POST',
                url: "Management/Config/Index.aspx?action=menu",
                dataType: "html",
                cache: false,
                success: function (html) {
                    $(".folder44").parent().parent().next().children().children().not(":first").remove();
                    $(".folder44").parent().parent().next().children().append(html);
                    $("a[rel=navTab]").each(function () {
                        $(this).click(function (event) {
                            var $this = $(this);
                            var title = $this.attr("title") || $this.text();
                            var tabid = $this.attr("rel") || "_blank";
                            var fresh = eval($this.attr("fresh") || "true");
                            var external = eval($this.attr("external") || "false");
                            var url = unescape($this.attr("href")).replaceTmById($(event.target).parents(".unitBox:first"));
                            DWZ.debug(url);
                            if (!url.isFinishedTm()) {
                                alertMsg.error($this.attr("warn") || DWZ.msg("alertSelectMsg"));
                                return false;
                            }
                            navTab.openTab(tabid, url, { title: title, fresh: fresh, external: external });

                            event.preventDefault();
                        });

                    });
                    dialogAjaxDone(json);
                },
                error: DWZ.ajaxError
            });
        } else {
            dialogAjaxDone(json);
        }
    }
</script>